package com.hz.ruoyifarmbase.basedata.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hz.ruoyifarmbase.basedata.domain.AgrBaseWorker;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author 侯文波
 * @date 2025/3/5 11:20
 * @description: 工人信息接口
 */
@Repository
public interface AgrBaseWorkerMapper extends BaseMapper<AgrBaseWorker> {
    int insertAgrBaseWorker(AgrBaseWorker agrBaseWorker);

    @Select("SELECT worker_id, worker_name FROM agr_base_worker WHERE worker_type = #{workerType}")
    List<Map<String, Object>> selectByType(String workerType);


    @Select("select * from agr_base_worker where worker_phone = #{workerPhone} and worker_password = #{workerPassword}")
    AgrBaseWorker login(AgrBaseWorker agrBaseWorker);

    @Select("select worker_name,worker_phone from agr_base_worker where worker_id = #{workerId}")
    AgrBaseWorker detail(Long workerId);
}
